<template>
  <div class="app-container">
    <AvatarUploader :config="config" :api="upload" @success="url=>imgUrl=url">
      <img :src="imgUrl" alt="">
    </AvatarUploader>
  </div>
</template>

<script>
import AvatarUploader from '@/components/AvatarUploader'
import { upload } from '@/api'
export default {
  components: {
    AvatarUploader
  },
  data() {
    return {
      upload,
      config: {
        cropper: {
          autoCropHeight: 150, // 默认生成截图框高度
          autoCropWidth: 150 // 默认生成截图框宽度
        }
      },
      imgUrl: require('@/assets/avatar.png')
    }
  },

  methods: {

  }
}
</script>

